IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[spVehicle_UpdateVehicle]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spVehicle_UpdateVehicle]
GO

GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eric Liew
-- Create date: 6/2/2009
-- Description:	Get all vehicle
-- =============================================
CREATE PROCEDURE [dbo].[spVehicle_UpdateVehicle]
(
	@VehicleId INT,
	@EngineNo VARCHAR(40),
	@ManufactureDate DateTime,
	@CarExpiryDate DATETIME,
	@RegistrationDueDate DateTime,
	@InspectionDate DateTime,
	@PurchasePrice Varchar(50),
	@OwnerId INT,
	@PurchaseDate DateTime,
	@Rego Varchar(10),
	@BodyType INT,
	@Model Varchar(20)

)AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	UPDATE Vehicle
	SET EngineNo = @EngineNo,
		ManufactureDate = @ManufactureDate,
		CarExpiryDate = @CarExpiryDate,
		RegistrationDueDate = @RegistrationDueDate,
		InspectionDate = @InspectionDate,
		PurchasePrice = @PurchasePrice,
		OwnerId = @OwnerId,
		PurchaseDate = @PurchaseDate,
		Rego = @Rego,
		BodyType = @BodyType,
		Model = @Model
	WHERE
	VehicleId = @VehicleId 
 

END
GO
